﻿
<html>

<head>
<title>Search Page</title>
</head>
<body>
<H1 align="center">SEARCH ANGEL</H1>

<form method="POST" action="searchResult.php" align="center">
   Input Search Name: 
   <input type="text" name="_name">
   <input type="submit" value="Send">
</form>

<?php
$name = $_POST['_name'];

$link=mysql_connect("localhost", "root" ,"1123");
$result = mysql_db_query("dd","select*
							 from staff
							 where name like '%".$name."%'
							 order by ID"); //name要符合SQL字串方式傳送 = 'name'

//標題
$main .='<table width="700" border="solid" align="center">
		 <tr>
			 <td align="center" class="bodyText">ID</td>
			 <td align="center" class="bodyText">Name</td>
			 <td align="center" class="bodyText">gender</td>
			 <td align="center" class="bodyText">birthday</td>
			 <td align="center" class="bodyText">address</td>
			 <td align="center" class="bodyText">salary</td>
			 <td align="right"  class="bodyText"></td>
		 </tr>';
//每一列
while ( list($a, $b, $c, $d, $e, $f)= mysql_fetch_row($result) ){
	$main .=
	'<tr>
		<td align="center">' . $a . '</td>
		<td align="center">' . $b . '</td>
		<td align="center">' . $c . '</td>
		<td align="center">' . $d . '</td>
		<td align="center">' . $e . '</td>
		<td align="center">' . $f . '</td>
		<td><a href="ModifyOrDelete.php?TagID='.$a.'" ;>修改或刪除</a></td>
	</tr>';
}

//表格結尾
$main .='</table>';
		  
echo $main;

mysql_close ($link);
?>

<div align= "center"><a href= "staff.php">  返回上一頁 </a></div>
</body>
</html>
